import http from '@/plugins/aixos'
import type { AcrossModel, AcrossViewModel } from '@/types/model'

export function findAllAcross(args: Record<string, any>) {
  const url =
    '/across?' +
    Object.entries(args)
      .map(([key, value]) => `${key}=${value}`)
      .join('&')
  return http.request<AcrossViewModel[]>({
    url,
    method: 'GET',
  })
}

export function addManyAcross(data: AcrossModel[]) {
  return http.request<AcrossModel[]>({
    url: '/across/many',
    method: 'POST',
    data,
  })
}

export function delManyAcross(id: number) {
  return http.request({
    url: '/across/many/' + id,
    method: 'DELETE',
  })
}
